package com.gitee.source

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment,_}
/*
  基于集合的sourceAPI和DataSet中的SourceAPI一样
 */
object SourceCollectionTest {
  def main(args: Array[String]): Unit = {
    val senv: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
    val array: DataStream[String] = senv.fromCollection(Array("spark","flink"))
    val data: DataStream[String] = senv.fromElements("spark","flink")
    val range: DataStream[Long] = senv.generateSequence(1,100)
    array.print("01>>>")
    data.print("02>>>")
    range.print("03>>>")
    senv.execute()
  }
}
